['symbolic.pro'].
['printmessages.pro'].
['rules.pro'].

current_prolog_flag(argv,L),nth1(2,L,FILE), [FILE].

current_prolog_flag(argv,L),nth1(3,L,PR),nth1(4,L,ROLE),print('\n\\section{Protocol role '), print(PR), print(': '), print(ROLE), print('}\n\n').

print('Messages known by actor:\n\n').
current_prolog_flag(argv,L),nth1(3,L,PR),nth1(4,L,ROLE),forall(protoknow(PR,ROLE,M),printmessage(M)).

print('\\subsection{Symbolic derivation table}\n\n').

%print('\\begin{longtable}{ll}\n').

current_prolog_flag(argv,L),nth1(3,L,PR),nth1(4,L,ROLE),forall(dertable(PR,ROLE,M,REQS),printentryreqs(M,REQS)).

%print('\\end{longtable}\n').

print('\n\\subsection{Possible content equivalences}\n\n\\begin{longtable}{ll}\n').

current_prolog_flag(argv,L),nth1(3,L,PR),nth1(4,L,ROLE),forall(dertable(PR,ROLE,M,REQS),printentryce(M)).

print('\\end{longtable}\n').

print('\n\\subsection{Possible internal equivalences}\n\n\n').

current_prolog_flag(argv,L),nth1(3,L,PROTO),nth1(4,L,ROLE),findall((M,REQ),dertable(PROTO,ROLE,M,REQ),KBN), printinternalcetex(KBN).


current_prolog_flag(argv,L),nth1(3,L,PR),nth1(4,L,ROLE),
findall(PRF,(dertable(PR,ROLE,M,REQS),contains([M|REQS],X),acts(X,ACTS),member(PRF,ACTS)),LST),list_to_set(LST,SET),
forall(member(PRF,SET),(print('\n\\subsection{Links of profile $'), print(PRF), print('$}\n\n'),
                        print('\\begin{longtable}{ll}\n'),
                        forall(dertable(PR,ROLE,M,REQS),printentrylinks(PRF,M)),
                        print('\\end{longtable}\n')
      )).
